# Maintainer: David Runge <dvzrv@archlinux.org>

_name=django-allauth
pkgname=python-django-allauth
pkgver=0.54.0
pkgrel=2
pkgdesc="Authentication, registration, account management and 3rd party account authentication"
arch=(any)
url="https://github.com/pennersr/django-allauth"
license=(MIT)
depends=(
  python
  python-django
  python-openid
  python-requests
  python-requests-oauthlib
  python-pyjwt
)
makedepends=(
  python-build
  python-installer
  python-setuptools
  python-wheel
)
checkdepends=(python-pytest)
# tests are not available in pypi sdist:
# https://github.com/pennersr/django-allauth/issues/2439
# source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
source=($_name-$pkgver.tar.gz::https://github.com/pennersr/$_name/archive/$pkgver.tar.gz)
sha512sums=('87914f01a788115fc70f9c221541373898af368ce7776a4db2047db1762d202e8aee0edbd247275ae01618a6d71d72e4c7eb7b7f531d1f44929ff04f659d38e3')
b2sums=('7690e7c4d1c62f366afc8c13dfaae227dfe54cf892abb20e33d04434768f2b9c54ed34e9326edef98d6eb07fbe2e34b587a40c5ec4df9792a781349dc610ab41')

build() {
  cd $_name-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name-$pkgver
  python manage.py test allauth
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}
